// pages/2411Ayiliao-pages/inpatient/inpatient-info.js
Page({
	data: {
		hospitalInfo: {
			hospitalArea: '北京市第一人民医院-东院区',
			department: '特需病院区',
			admissionTime: '2020/10/09 09:00:00',
			dischargeTime: '2020/10/09 09:00:00',
			status: '住院中'
		},
		patientInfo: {
			name: '牛韦',
			idType: '身份证',
			idNumber: '610*********0989',
			phoneNumber: '158****8900',
			medicalCardNumber: '20209000709',
			hospitalizationNumber: '390090'
		}
	},

	onLoad() {
		// 获取选中的患者信息
		const selectedPatient = wx.getStorageSync('selectedPatient')
		if (selectedPatient) {
			this.setData({
				'patientInfo.name': selectedPatient.name,
				'patientInfo.idNumber': selectedPatient.idNumber
			})
		}
	},

	recharge() {
		// 传递患者信息到住院充值页面
		const patientData = {
			name: this.data.patientInfo.name,
			inpatientNumber: this.data.patientInfo.hospitalizationNumber
		}
		wx.navigateTo({
			url: `/pages/2411Ayiliao-pages/inpatient/recharge?data=${encodeURIComponent(JSON.stringify(patientData))}`
		})
	}
}) 